import 'package:cream_chat_flutter/globals/ThemeProvider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import 'HomeTabPageProvider.dart';
import 'MyRelatedItem.dart';

class BuildMyRelatedList extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _BuildMyRelatedListState();

}

class _BuildMyRelatedListState extends State<BuildMyRelatedList> {
  @override
  Widget build(BuildContext context) {
    return Consumer2(builder: (BuildContext context, ThemeProvider tp, HomeTabPageProvider htp, Widget child)=>Column(
      children: [
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            tp.Title("和我相关"),
            GestureDetector(
              onTap: () {
                print("查看全部和我相关");
              },
              child: tp.NmTip("全部"),
            )
          ],
        ),
        Container(
          height: 125,
          child: ListView(
              scrollDirection: Axis.horizontal,
              children: [
                getMyRelatedItem(tp,"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1306508493,2006189766&fm=26&gp=0.jpg",
                    tp.EllipsisText("沐熙呀"), 1, 25, 10),
                getMyRelatedItem(tp,"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1306508493,2006189766&fm=26&gp=0.jpg",
                    tp.EllipsisText("沐熙呀"), 2, 21, 21),
                getMyRelatedItem(tp,"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1306508493,2006189766&fm=26&gp=0.jpg",
                    tp.EllipsisText("沐熙呀"), 2, 23, 33),
                getMyRelatedItem(tp,"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1306508493,2006189766&fm=26&gp=0.jpg",
                    tp.EllipsisText("沐熙呀"), 1, 27, 16),
                getMyRelatedItem(tp,"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1306508493,2006189766&fm=26&gp=0.jpg",
                    tp.EllipsisText("沐熙呀"), 1, 31, 7),
              ]
          ),
        ),
      ],
    )
    );
  }

}